<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<div id="app">
			<input type="text" v-model="message" />
			使用计算属性实现字符串反转:{{reverseStr}}
		</div>
		
		<script src="../js/vuejs-2.5.16.js" type="text/javascript" charset="utf-8"></script>
		
		<script type="text/javascript">
			const vue = new Vue({
				el: "#app",
				data: {
					message: ""
				},
				methods: {
					
				},
				//计算属性用computed
				computed: {
					//计算属性必须有返回值return
					reverseStr:function(){
						return this.message.split("").reverse().join("");
					}
					
				}
			})
		</script>
		
	</body>
</html>
